package engine.tip.tipItem
{
	import engine.data.ObjectData;
	import engine.flag.GameDefine;
	import engine.newUi.ActorPropertyUI;
	import engine.newUi.DetailPropertyLogic;
	import engine.tip.TipsMainLogic;
	
	import newx.com.config.StaticIni;
	
	/**
	 *伙伴tips 
	 * @author yanghr
	 * 
	 */	
	public class PartnerItem extends BaseTipItem
	{
		private var _detail:DetailPropertyLogic
		private const PART_NAME:String		=	"nname",
			PART_GANG:String	=	"ProfType",
			PART_TASK:String	=	"NeedTaskID",
			PART_MONEY:String	=	"NeedGoldCoin",
			PART_NEED_LEVEL:String	=	"PartnerInviteLevel",
			PART_HEAD:String	=	"Model",
			PART_COMMEND:String	=	"NeedRecommend",
			PART_HALF:String	=	"Model",
			PART_CONFIG_ID:String	=	"ConfigID",
			PART_SKILL:String	=	"DefaultUltraSkill",
			PART_SKILL_DES:String	=	"skill_dest",
			PART_HP:String		=	"HP",
			PART_MAXHP:String	=	"MaxHP",
			PART_ING:String		=	"Ing",
			PART_STA:String		=	"Sta",
			PART_STR:String		=	"Str",
			PART_PEER:String	=	"NeedRepute",
			PART_LEVEL:String	=	"Level";
		public function PartnerItem(dataObject:ObjectData=null,data:Object=null)
		{
			super(dataObject,data);
		}
		override public function getMainStr():String
		{
			return (StaticIni.getSwfLangStrVar("stringpartner_001",getPartnerArr()))
		}
		public function get detail():DetailPropertyLogic
		{
			if(!_detail)
				_detail=DetailPropertyLogic.getInstance();
			return _detail
			
		}
		public function getPartnerArr():Array
		{
			detail.setData(_data);
			var plist:Array = [];
			plist.push(getName());
			plist.push(getLevel());
//			plist.push(getProfType());
			plist.push(getSkill());
			plist.push(getSkillDes());
			plist.push(getHp());
			plist.push(getMaxHp());
			plist.push(getStr());
			plist.push(getIng());
			plist.push(getSta());
			plist.push(objTranfer(getColor(_data[PART_MONEY],_role.getGoldCoin())));
			plist.push(objTranfer(getColor(_data[PART_PEER],_role.GetPropertiesEx("Repute"))));
			plist.push(objTranfer(getColor(_data[PART_NEED_LEVEL],_role.GetPropertiesEx(ActorPropertyUI.PARTNER_INVITE))))
			return plist
			function getColor(needcount:int,nowCount:int):String
			{
				return TipsMainLogic.instance.getColorHtml(needcount+"",needcount>nowCount?"ff0000":"")
			}
			 function objTranfer(obj:*):String
			{
				if(!obj)
					return 0+""
				return obj;
			}
		}
		//门派
		public function getProfType():String
		{
			return GameDefine.PART_GANG(_data["Nation"]);
		}
		/**
		 *伙伴等级 
		 * @return 
		 * 
		 */		
		public function getLevel():String
		{
			return _data["Level"]?_data["Level"]:(1+"");
		}
		/**
		 *技能 
		 * @return 
		 * 
		 */		
		public function getSkill():String
		{
			var str:String=StaticIni.getSwfLangStr(_data["DefaultUltraSkill"]);
			return str;
		}
		/**
		 *技能描述 
		 * @return 
		 * 
		 */		
		public function getSkillDes():String
		{
			var str:String=GameDefine.GET_SKILL_DES(_data["DefaultUltraSkill"])//StaticIni.getSwfLangStr("Des_"+)
			return str;
		}
		/**
		 *生命 
		 * @return 
		 * 
		 */		
		public function getHp():String
		{
//			var str:String = _data["HP"]?_data["HP"]:_data["MaxHP"];
//			return str;
			return getMaxHp();
		}
		/**
		 *最大生命 
		 * @return 
		 * 
		 */		
		public function getMaxHp():String
		{
			var str:String=_detail.maxlife//_data["MaxHP"]?_data["MaxHP"]:(GameDefine.GET_MAXHP(_data["Sta"])+"");
			return str;
		}
		/**
		 *体魄 
		 * @return 
		 * 
		 */		
		public function getSta():String
		{
			var str:String=_detail.sta//int(_data["Sta"])+"";
			return str;
		}
		/**
		 *外功 
		 * @return 
		 * 
		 */		
		public function getStr():String
		{
			var str:String=_detail.outwork//int(_data["Str"])+"";
			return str;
		}
		/**
		 * 内功
		 * @return 
		 * 
		 */		
		public function getIng():String
		{
			var str:String=_detail.interwork//int(_data["Ing"])+"";
			return str;
		}
	}
}